/**
 * Created by Administrator on 2017\9\7 0007.
 */
import React from 'react';
import template from './../commonui/template';
import { Link } from 'react-router-dom';
import {Form,Icon,Input,Button,CheckBox,Row,Col} from 'antd';
const FormItem = Form.Item;

class LoginForm extends React.Component{
    constructor(props){
        super(props);
        this.handleLb=this.handleLb.bind(this);
        this.handleSubmit=this.handleSubmit.bind(this);
        this.state={
            lb:'个人用户',
            formdata:{}
        }
    }
    handleLb(e){
        console.log(e);
    }
    handleSubmit(){
        
    }
    render(){

        const {getFieldDecorator} = this.props.form;
        const formItemLayout ={
            labelCol:{
                xs:{span:14},
                sm:{span:6}
            },
            wrapperCol:{
                xs:{span:24},
                sm:{span:14}
            }
        };
        const tailItemLayout={
            wrapperCol:{
                xs:{span:24,offset:0},
                sm:{span:14,offset:6}
            }
        };
        return (
            <div>
                <div onClick={this.handleLb}>
                    <span>
                        企业用户
                    </span>
                    <span>
                        个人用户
                    </span>
                </div>
                <div>
                    <Form onSubmit={this.handSubmit}  >
                        <FormItem {...formItemLayout} label="Telephone" >
                            {getFieldDecorator('phoneNO',{rules:[{required:true,message:'Please input your telephone'}]})(
                                <Input prefix={<Icon type="phone"/>} style={{fontSize:13}} />
                            )}
                        </FormItem>
                        <FormItem {...formItemLayout} label="Captcha">
                            <Row gutter={24}>
                                <Col span={12}>
                                    {getFieldDecorator('captcha',{rules:[{
                                        required:true,message:'Please input the captcha you got'
                                    }]})
                                    (
                                        <Input size="large"/>
                                    )}
                                </Col>
                                <Col span={12}>
                                    <Button size="large">Get captcha</Button>
                                </Col>
                            </Row>
                        </FormItem>
                        <FormItem {...tailItemLayout}>
                            <Button size="large">Login</Button>
                        </FormItem>
                    </Form>
                </div>
                <div>
                    <span>
                          <Link to={'/Fgt'}><span>忘记密码/手机号</span></Link>
                    </span>
                    <span>
                          <Link to={'/RgstCst'}><span>注册{this.state.lb}</span></Link>
                    </span>
                </div>
            </div>
        )
    }
}

const Login =Form.create()(LoginForm);
export default template({
    id: 'Login',
    component: Login
});